package com.yj.rabbitClient.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class RabbitMQConsumer {


    @RabbitListener(queues = "apple-queue")
    public void consumerApple(String message){
        log.info("apple-queue队列中接收到的消息：{}，时间：{}",message,System.currentTimeMillis()/1000);
        System.out.println(message);
    }


    @RabbitListener(queues = "banana-queue")
    public void consumerBanana(String message){
        log.info("banana-queue队列中接收到的消息：{}，时间：{}",message,System.currentTimeMillis()/1000);
        System.out.println(message);
    }
}
